// nim.h    Header file for Nim project
#ifndef NIM_H
#define NIM_H
#include <winsock2.h>
#pragma comment (lib, "ws2_32.lib")

static char  BROADCAST_ADDR[20] = "10.1.255.255";

const char UDPPORT_NIM[] = "29333";
const char TCPPORT_NIM[] = "29334";
const int  MAX_SEND_BUF  = 128;
const int  MAX_RECV_BUF  = 2048;
const int  MAX_HOSTNAME  = 1024;
const int  MAX_SERVICE   = 10;
const int  MAX_LINE      = 1024;
const int  MAX_NAME      = 1024;
const int  MAX_HOST      = 100;

void chomp (char*);
char* timestamp(void);
void server_main(int,char*[]);
void client_main(int,char*[]);
void play_Nim(SOCKET, bool, char*);
int udp_recv(SOCKET, char*, int, char*, char*);
int udp_send(SOCKET, char*, int, char*, char*);
int tcp_recv(SOCKET, char*, int, char*, char*);
int tcp_send(SOCKET, char*, int, char*, char*);
int wait(SOCKET, int, int);
SOCKET passivesock (char*, char*);
SOCKET connectsock (char*, char*, char*);

#endif
